Portable Spa Monitoring And Control Circuitry

ABSTRACT

Control circuitry for controlling a spa water heater, wherein a microcontroller is configured to detect zero crossings of an A.C. line voltage from a voltage sense signal, to cause closing of a first heater relay and a second heater relay, to detect the time at which heater current is initially sensed by a current sensor after the initial closing of the second heater relay, to measure a time delay between the time that the second heater relay is closed and the time at which heater current is initially sensed, and to adjust the time at which a second closing of the second heater relay occurs such that zero crossings of the heater current occur at the same time as zero crossings of the voltage waveform. The control circuitry further includes a voltage sense circuit comprising a first diode connected in series with a current limiting resistance connected in series with a Zener diode, which is in turn connected in series with an optical coupler LED.

BACKGROUND OF THE INVENTION

1. Field of Invention

The subject disclosure relates to spa monitoring and control circuitry for portable spas, tubs and the like and more particularly to voltage sensing circuitry for determining the magnitude, frequency and zero cross times of an input signal, and to circuitry for timing the opening and closing of heater relays to occur at or near zero cross points.

2. Related Art

Portable spas have become quite popular as a result of their ease of use and multiplicity of features such as varied jet and seating configurations. One area where the inventor has recognized that improvement would be desirable concerns the manner of efficiently maintaining and controlling various spa equipment operations, and particularly the operation of the spa water heater and associated relays.

SUMMARY

The following is a summary description of illustrative embodiments of the invention. It is provided as a preface to assist those skilled in the art to more rapidly assimilate the detailed design discussion which ensues and is not intended in any way to limit the scope of the claims which are appended hereto in order to particularly point out the invention.

According to an illustrative embodiment, control circuitry for controlling a spa water heater comprises first and second relays closeable to supply current to the spa water heater together with a current sensor for generating a current sense signal, a voltage sensor circuit for generating a voltage sense signal, and a microcontroller supplied with the current sense and voltage sense signals. The microcontroller is configured to detect zero crossings from the voltage sense signal and to cause closing of the first heater relay and the second heater relay. The microcontroller is further configured to detect the time at which heater current is initially sensed by the current sensor after the initial closing of the second heater relay, and to measure a time delay between a zero crossing of the voltage waveform and the time at which heater current is initially sensed. The microcontroller thereafter employs the measured time delay to adjust the time at which a second closing of the second heater relay occurs such that the closure of the relay contacts is synchronous with a zero crossing of the voltage waveform.

The same circuitry configuration is also employed to synchronize the relay contact opening with a zero crossing of the voltage waveform.

In one embodiment, the voltage sensor circuit may comprise a first diode connected in series with a current limiting resistance connected in series with a Zener diode, which is in turn connected in series with an optical coupler LED. In this illustrative embodiment, an A.C. voltage to be sensed is coupled across one terminal of the first diode and one terminal of the optical coupler LED. The optical coupler LED comprises part of an optical coupler circuit whose output provides a voltage sense signal comprising a pulse train whose pulse width is proportional to the A. C. input voltage.

DETAILED DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of one embodiment of a spa system;

FIG. 2 is an electrical circuit diagram of an illustrative embodiment of spa monitoring and control circuitry;

FIG. 3 is a wave form diagram illustrating operation of the circuit of FIG. 2 during a first, “turn on” operation;

FIG. 4 is a wave form diagram illustrating a second “turn on” operation;

FIG. 5 is a wave form diagram illustrating a “turn-off” operation;

FIG. 6 is an electrical circuit diagram of an illustrative embodiment of a voltage sensor circuit;

FIG. 7 is a graph illustrating the pulse width to voltage relationship for the circuit of FIG. 6; and

FIG. 8 illustrates edge detect operation as performed by the illustrative embodiment.

DETAILED DESCRIPTION

FIG. 1 illustrates one embodiment of a spa system 11. In this system 11, water is circulated through a water circulation path 12. In the water circulation path 12 are a spa tub 13, a circulation pump 15, a resistive heater 23, a spa controller 29, a regulating temperature thermistor 17, a high-limit thermistor 19, and a pressure sensor 18 to sense proper water flow. In one embodiment, the spa controller 29 interfaces with a control head 31, which includes a user interface 33. The spa controller 29 may include one or more microprocessors or microcontrollers, as well as fault detection hardware, which may receive inputs from the high limit temperature sensor 19, the temperature regulation sensor 17, and the pressure regulation sensor 18. In particular, the value sensed by the thermistor 17 may be used by the microcontroller 29 to regulate water temperature, and the value measured by thermistor 19 may be used to shut off heater operation if the water temperature exceeds, for example, 120° F. The controller 29 may further be configured to switch “on” or “off” the spa water heater 23, one or more jet pumps, the circulation pump 15, an ozone generator, an audio system and/or spa lights and external lighting.

Spa heaters such as the resistive heater 23 of FIG. 1 typically require significant power and their operation can shorten the life of the relays that switch the heater power as a result of relay contact arcing on turn-on and turn-off According to an illustrative embodiment, opening and closing of a switching relay is timed to occur synchronously with the zero voltage crossing of the AC power line, thus minimizing arcing and wear. The illustrative embodiment senses the actual current to the heater 23, leaving no doubt when switching occurred and improves the system by providing early fault detection. The illustrative embodiment also provides additional protection against welded-closed relay contacts and the resulting fire hazard from continuous heater operation. The integrity of both relays is checked before proceeding, at a time when recovery and hazard prevention is still possible.

“Zero-cross switching” means that the relay contacts open or close at a time selected to cause the sine wave heater current to cross at or near zero near the time that the AC sine wave voltage changes its electrical polarity, resulting in minimal or no contact arcing and wear. The opposite of zero-cross switching is switching at peak voltage of the sine wave, which can result in significant arcing and contact wear, as well as increased potential for contact welding. In exemplary embodiments, the AC voltage frequency is 60 Hz and its RMS magnitude is 120 or 240 volts.

A zero-cross switching circuit 111 according to an illustrative embodiment is shown in FIG. 2 and includes:

-   -   a) A current sense transducer 24 capable of sensing the current         waveform of current flowing to a heater 23. The transducer 24         may be, for example, a Hall Effect transducer or sensor;     -   b) A zero cross detector circuit 27 to sense the timing of the         supply voltage; and     -   c) Two relays A, B to switch each leg 28, 30 of the line voltage         to the heater element 23, called “Relay A” and “Relay B”.         In the illustrative circuit embodiment of FIG. 2, the Diode D2         is connected directly to the full line voltage V_(LINE),         typically in the range of 100 to 250 volts AC (50 or 60 hz).

Relay “Turn On” Operation

The operation of the illustrative embodiment is as follows: a signal S₁ from the controller 29 turns on the relay A without any zero crossing adjustment, while leaving relay B off. The controller 29 then checks to make sure that there is no heater current sensed by the current sense circuit 24. If no heater current is sensed, the control flow proceeds to the next step. If heater current is sensed, the controller 29 determines that the relay B is welded closed and that the circuit has failed, requiring appropriate corrective action to prevent creation of a safety hazard from uncontrolled heating if relay A is also welded closed. If no heater current is sensed, the relay B is then turned on by control signal S₂ after, for example, a 500 millisecond delay.

Assuming no heater current is sensed when the relay A is closed by signal S₁, the zero voltage crossing input line 21 from the zero cross detector 27 is monitored to sense the timing of the zero voltage crossings (positive or negative). The A.C. signal is applied to the zero cross detector 27 prior to closing the relay A, such that it is already detecting zero crossings prior to closing the relay A. The current sensor 24 is also monitored to determine when current starts flowing to the heater 23, representative of how long it took the relay B to close relative to when its coil 32 was energized (turned on) by applying a signal S₂. A predetermined delay time is then calculated so that the relay B will close at or near the zero voltage crossing the next time that the heater 23 is turned on.

Thus, the relay actuation time is tuned by:

-   -   Turning on the relay B with zero delay adjustment from zero         cross the first time that the heater 23 is turned on.     -   Measuring the increase in current and relative timing from the         current sensor 24 to determine an appropriate delay from the         voltage zero cross to set the relay actuation time for the next         time that the heater 23 is turned on.

The delay time calculation is illustrated graphically in FIG. 3 where the relay B coil voltage, the control signal S₂ and the heater current are respectively graphed with respect to time on time lines 35, 37, 39. As illustrated, the signal S₂ is supplied to Relay B at time t₀, causing heater current to be sensed later at time t₁. The turn on delay between the application of the control signal S₂ and the generation of heater current is “T_(D)”. This time interval “T_(D)” is detected and stored by the controller 29.

FIG. 4 illustrates circuit operation the next time that the heater 23 is turned on. Based on the input from the voltage sensing circuit 27, the microcontroller 29 “knows” that a zero crossing of the voltage waveform will occur at time t⁻². The microcontroller 29 then waits until time t₁ to apply the control signal S₂ to the coil 32 of the relay B. The time interval T_(E) between the zero crossing at t⁻² and the generation of the control signal S₂ at time t⁻¹ is equal to a half period of the sine wave (0.5 divided by the line frequency wf, e.g. 50 or 60 Hz) minus the delay time T_(D) or:

$\frac{.5}{wf} - T_{D}$

As illustrated in FIG. 4, generation of the control signal S₂ at time t₁ results in the relay B contacts closing and the coil B current beginning to flow at a point in time which aligns with a zero crossing of the voltage waveform.

The predetermined delay time T_(D) is subsequently adjusted each time the relay B is turned on, resulting in the delay time tracking relay wear over the relay's lifespan. Example Calculation: S2 turn On Delay relative to Zero Voltage Crossing=8.333 ms−Sensed Current Turn On Relative to Last Zero Voltage Crossing.

Depending on the relay response time, calculations may also be adjusted to accommodate T_(d) turn-on times of greater than ½ cycle of the AC line voltage, i.e., straddling more than one AC half-cycle.

Relay “Turn Off” Operation

With respect to the heater turn-off sequence, the timing for zero voltage crossings is again determined. Since turn off can produce extended arcing and continuation of the heater current for several milliseconds after the actual contact opening, the algorithm gradually reduces the delay until near zero current is seen at a point about 2 to 3 milliseconds after a zero cross time.

With the heater on and a request to turn off, a first zero cross is determined using the Vsense input. A delay timer is then started using a pre-determined delay from a previous cycle, or initially a time value set to slightly shorter than the sample time. At the same moment (as of the first zero cross time), a fixed-time sample timer is started. As described above, this time is set to sample the current about 2-3 milliseconds after a subsequent zero crossing, and should be set longer than any anticipated relay turn off time. Relay A is turned off when the delay timer times out, and current is sampled when the sample timer times out. The delay time is then reduced if the current at the sample point is much greater than zero amps, indicating that the relay has either not opened at all, or that arcing is occurring. This process is repeated for each subsequent turn off cycle until the delay has been reduced to the point where the current at the sample time is near zero.

In illustrative embodiments, “zero” current is typically not “absolute” zero. For example, in some embodiments with heaters that range from 16-23 amps, a ±3 amps threshold may be detected or treated as “zero.” In various embodiments, switching within 1 to 2 milliseconds of a zero crossing will be effective to satisfactorily suppress contact arcing and contact wear.

FIG. 5 further illustrates operation of one embodiment of a relay turn-off mechanism. After detection of a zero crossing at time t₁, a relay delay timer and a sample timer are started. When the relay delay timer times out at time t₄, the relay coil is de-energized. When the sample timer times out at time t₃, the heater current is sampled. The delay is reduced slightly for each turn off cycle until there is near zero current at the sample time t₃, meaning that the contacts actually opened at time t₂ and because it is at zero crossing, no arc-continuation current is seen at the sample time. After turning off the relay A, a check is made to ensure that the heater current went to zero. If no heater current is sensed, the controller 29 proceeds to turn off relay B, no errors. If heater current is sensed, this indicates that relay A is welded closed and the circuit has failed, requiring an appropriate corrective action to prevent creation of a safety hazard from uncontrolled heating if relay B also is welded closed. Once the relay B is turned off, the heater 23 is fully off.

An illustrative embodiment of a spa equipment control system employs both current sensors and voltage-to-pulse-width circuits for measuring various parameters. With these parameters, the power consumption of the spa can be computed and logged for reports to the owner or service technician. In addition, operation can be restricted if the voltage is too low, and the service technician can be alerted if currents suddenly shift on a particular spa device (jet pump, heater, music system, etc.).

In one embodiment, a spa is supplied from up to three high voltage circuits. To measure voltages on these circuits, the voltage-to-pulse width circuit 121 shown in FIG. 6 is used in conjunction with software to compute the line voltages in the system. FIG. 6 illustrates the following components wired in series and connected across the voltage source to be measured: a half-wave diode D₅, a current limiting resistance R₁₆, a zener diode D₄, and an optical coupler LED D₆ at the input side of an optical coupler IC A₂. In certain embodiments, the current limiting resistance R₁₆ may comprise one or more discrete resistors, for example, two 10K ohm resistors.

With respect to the operation of the illustrative embodiment of FIG. 6, the diode D₅ causes voltage information to be provided only for every other half-cycle of the input AC voltage waveform V₁ (positive or negative only). Since the line voltage is a sine wave, the zener diode D₄ will not conduct current until its threshold is reached. Once its threshold is reached, the current starts flowing through the optical coupler LED D₆, resulting in the turn-on of the optical isolator output transistor Q₁. Once the line voltage sine wave again descends below the zener threshold, the current stops and the output transistor Q_(‘)of the optical isolator A₂ turns off.

As a result of this operation, the output V_(sense) of the circuit 121 is a pulse train, whose pulse width is proportional to the line voltage V₁. This pulse train is timed by the microcontroller 29. The microcontroller software can then determine the following parameters:

-   -   a) Voltage, by translating the pulse width to a voltage based on         either a formula or a lookup table with intermediary         computations of values for points between table entries. As         illustrated in FIG. 7, the pulse width-to-voltage relationship         is not linear.     -   b) Line frequency—The period of the pulse train represents the         reciprocal of the line frequency.     -   c) Zero cross time—The zero cross time event can be computed by         determining the time of occurrence of the exact middle of a         pulse, then adding or subtracting 25% of the period. This         computed time is the time of zero crossing and is used in the         heater relay zero cross computations described in connection         with the circuit of FIG. 2. To compute the time occurrence of         zero voltage cross, a free running timer is used. The system         registers the timer value when each edge of the pulse occurs.         Then the timer value at the midpoint of the pulse is computed.         From that center value, 25% of the period time value is added or         subtracted from the center time value to establish the timer         value for a zero crossing.     -   d) Enhancing Accuracy—The accuracy of the measurements is         enhanced if the zener voltage is close to the range of input         voltages. To accommodate a wide range of voltages (e.g., 90 to         260 VAC), two separate circuits 121 may be used, one optimized         for a lower range and a second optimized for a higher range of         voltages. The microcontroller 29 compares the two measurements         and uses the measurement that is optimized for the selected         voltage range, resulting in enhanced accuracy.

In one embodiment of the zero cross detect circuit, e.g. of FIG. 2, the microcontroller 29 uses an edge sensitive capture input, which is part of the microcontroller hardware on the microcontroller chip itself. The microcontroller's software first sets the capture input to sense a positive transition of the V_(sense) pulse train independent of software, and the next positive signal edge of the pulse train causes the value of a free-running hardware timer to be transferred at the moment of the edge to a latch. This edge also causes an interrupt to vector the microcontroller software to a routine that reads the latch value and re-programs the edge sense to sense the negative edge of the pulse train. The same process occurs when the negative edge occurs. So, the microcontroller software ends up producing a string of positive and negative edge time values for use in making the calculations described for detecting zero crossings relative to the free-running timer.

The zero cross logic is a continuous process, occurring on every positive and negative edge of the V_(sense) pulse train. This implementation prevents the presumed time of the zero cross from drifting. In addition, in one embodiment, continuous edge detection must be done to monitor the line voltage, since the pulse width is used for that purpose.

An example of edge detection as just described is shown in FIG. 8. As may be seen, due to the nature of the optical coupler Al, the sinusoidal waveform seen on the line voltage is translated to a square wave as seen by the microcontroller edge detect input. With respect to FIG. 8, the microcontroller 29 detects pulse edges, for example, at t₁ and t₂. In FIG. 8, the period “T” is computed form the previous and current cycle, and the zero cross time is computed for the next cycle (or subsequent cycles), since it is used to turn on a relay at a prescribed time synchronized with the next zero voltage crossing. Additionally, knowing t₁ and t₂, various other times may be computed. Various illustrative computations are:

t ₃ =t ₁+½(t ₂ −t ₁)   (equation 1)

Sinewave Period=T=t ₇ −t ₃   (equation 2)

Zero crossing t ₀ =t ₃+¼ T   (equation 3)

Zero crossing t ₄ =t ₃+¼ T   (equation 4)

Zero crossing t ₅ =t ₄+½ T   (equation 5)

Temperature-Relative Load Control—An illustrative control system embodiment utilizes a single high-capacity power supply to provide power to the internal electronics of the control system, as well as peripherals connected to RS-485 and I2C busses, such as chlorine generators, light systems, audio systems and so forth. Since the spa environment is very warm, the temperature may reduce the load capability of the power supply. In one embodiment, the microcontroller 29 can be configured to respond to these circumstances by a method comprising the following steps:

-   -   1) Monitor the temperature inside the control box, in relative         proximity to the power supply module. The control box typically         contains control componentry such as microprocessors, relays,         bus drivers, analog interfaces and so forth.     -   2) Monitor the current flowing to the peripherals.     -   3) If the temperature is at or above one of several thresholds,         and the current measured is above the limit for that         temperature, send commands to the various peripherals to force         them to power down, thus reducing the loading.     -   4) Continue shut downs on peripherals until within range for the         power supply.

The foregoing discussion sets forth logic for implementing control functions which may be implemented in various embodiments. In one embodiment, such logic may comprise hard wired logic. In other illustrative embodiments, such logic, as well as other logic discussed herein, is embodied in one or more computer programs or computer software, for example, such as an application written in C, assembly, or other suitable programming language. In one embodiment shown in FIG. 2, such software is stored on a computer readable medium or media 23 which may be executed by a microcontroller 29, which may comprise, for example, one or more microprocessors, digital processors, central processing unit(s) (CPUs), or other computer(s). In an illustrative embodiment, the microcontroller 29 may comprise a PIC32 microprocessor with 512K bytes of flash ROM, suitable amounts of RAM, EEPROM, and adequate I/O peripherals for the various serial port functions, for example, such as two RS-485 buses, 12C, SPI, etc. Apparatus for executing instructions of such computer programs or software may comprise part of either the spa controller 29 or the control head 31, or both, in various embodiments.

For the purposes of this disclosure, a computer readable medium stores computer data, which data can include computer program code that is executable by a computer, in machine readable form. By way of example, and not limitation, a computer readable medium may comprise computer readable storage medium or media, for tangible or fixed storage of data, or communication media for transient interpretation of code-containing signals. Computer readable storage medium or media, as used herein, refers to physical or tangible storage (as opposed to signals) and includes without limitation volatile and non-volatile, removable and non-removable storage media implemented in any method or technology for the tangible storage of information such as computer-readable instructions, data structures, program modules or other data. Computer readable storage media includes, but is not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other physical or material medium which can be used to tangibly store the desired information or data or instructions and which can be accessed by a computer or processor. In certain embodiments, when suitable computer program code is loaded into and executed by a computer, the computer becomes a specially configured apparatus.

Those skilled in the art will appreciate that various adaptations and modifications of the just described preferred embodiment can be configured without departing from the scope and spirit of the invention. Therefore, it is to be understood that, within the scope of the appended claims, the invention may be practiced other than as specifically described herein. 

1-16. (canceled)
 17. Control circuitry for controlling a spa heater comprising: first and second heater relays closeable to supply current to said heater; a current sensor for sensing heater current and generating a current sense signal; a voltage sensor for generating a voltage sense signal; and a microcontroller supplied with the current sense and voltage sense signals and configured to: (a) detect zero crossings of a voltage waveform from the voltage sense signal; (b) cause a first closing of the first heater relay; (c) cause a first closing of the second heater relay; (d) measure the time delay T_(D) between the time that the second heater relay is closed and the time at which heater current is initially sensed by the current sensor after the first closing of the second heater relay; and (e) employ the measured time delay T_(D) to adjust the time at which a subsequent closing of the second heater relay is caused to occur so that a zero crossing of the heater current occurs closer in time to a zero crossing of the voltage waveform.
 18. The control circuitry of claim 17 wherein said microcontroller comprises a microprocessor.
 19. The control circuitry of claim 17 wherein said time delay is employed to cause the subsequent closing of the second heater relay to occur a delay period of T_(E) after a zero crossing of the voltage waveform where $T_{E} = {\frac{.5}{wf} - T_{D}}$ where wf is a frequency of the voltage waveform.
 20. The control circuitry of claim 17 wherein said microcontroller is further configured to test the heater current after closing the first heater relay to detect a fault condition.
 21. The control circuitry of claim 20 wherein the fault condition detected is that the second heater relay is closed.
 22. The control circuitry of claim 17 wherein the voltage wave form is an A.C. line signal.
 23. The control circuitry of claim 19 wherein said microcontroller comprises a microprocessor.
 24. The control circuitry of claim 17 wherein the subsequent closing of the second heater relay is caused to occur at a time which aligns with the time of a zero crossing in the voltage wave form.
 25. The control circuitry of claim 19 wherein a voltage waveform zero crossing is a time computed based on the time of occurrence of a rising or falling edge of said voltage sense signal.
 26. The control circuitry of claim 17 wherein said microcontroller is further configured such that, after said subsequent closing of the second heater relay, the time delay between the time that the second heater relay is closed and the time that heater current is sensed is again measured and employed to further adjust the time of closing of the second heater relay.
 27. The control circuitry of claim 17 wherein said microcontroller is further configured to implement a relay turn-off mechanism comprising: starting a sample timer and a delay timer after detection of a zero crossing at a time t₁; de-energizing a relay coil of a first relay when the delay timer times out after a selected delay time; sampling the heater current when the sample timer times out; and reducing the selected delay time for each turn-off cycle until there is a near zero current at the sample time.
 28. The control circuitry of claim 27 wherein the relay turn-off mechanism further comprises: after turning off the first relay, testing to ensure that the heater current went to zero; if no heater current is sensed, proceeding to turn off a second heater relay.
 29. The control circuitry of claim 28 wherein if heater current is sensed after turning off the first relay, such sensing is detected as a fault condition in one or both of the first and second relays.
 30. A tangible computer readable storage medium having non-transitory computer software stored thereon, which when executed by one or more computer processors, microprocessors, or microcontrollers is operable to: (a) detect zero crossings of a voltage waveform from a voltage sense signal; (b) cause a first closing of a first heater relay; (c) cause a first closing of a second heater relay; (d) measure the time delay T_(D) between the time that the second heater relay is closed and the time at which heater current is initially sensed by the current sensor after the first closing of the second heater relay; and (f) employ the measured time delay T_(D) to adjust the time at which a subsequent closing of the second heater relay is caused to occur so that a zero crossing of the heater current occurs closer in time to a zero crossing of the voltage waveform.
 31. The control circuitry of claim 30 wherein said time delay is employed to cause the subsequent closing of the second heater relay to occur a delay period of T_(E) after a zero crossing of the voltage waveform where $T_{E} = {\frac{.5}{wf} - T_{D}}$ where wf is a frequency of the voltage waveform.
 32. The control circuitry of claim 30 wherein said microcontroller is further configured to test the heater current after closing the first heater relay to detect a fault condition.
 33. The control circuitry of claim 32 wherein the fault condition detected is that the second heater relay is closed.
 34. The control circuitry of claim 30 wherein the voltage wave form is an A.C. line signal.
 35. The control circuitry of claim 31 wherein said microcontroller comprises a microprocessor.
 36. The control circuitry of claim 32 wherein the subsequent closing of said second heater relay is caused to occur at a time which aligns with the time of a zero crossing in the voltage wave form.
 37. The control circuitry of claim 31 wherein a voltage waveform zero crossing is a time computed based on the time of occurrence of a rising or falling edge of said voltage sense signal.
 38. The control circuitry of claim 32 wherein said microcontroller is further configured such that, after said subsequent closing of the second heater relay, the time delay between the time that the second heater relay is closed and the time that heater current is sensed is again measured and employed to further adjust the time of closing of the second heater relay.
 39. The control circuitry of claim 32 wherein said microcontroller is further configured to implement a relay turn-off mechanism comprising: starting a sample timer and a delay timer after detection of a zero crossing at a time t₁; de-energizing a relay coil of a first relay when the delay timer times out after a selected delay time; sampling the heater current when the sample timer times out; and reducing the selected delay time for each turn-off cycle until there is a near zero current at the sample time.
 40. The control circuitry of claim 39 wherein said mechanism further comprises: after turning off the first relay testing to ensure that the heater current went to zero; if no heater current is sensed, proceeding to turn off a second heater relay.
 41. The control circuitry of claim 40 wherein if heater current is sensed after turning off the first heater relay, such sensing is detected as a fault condition in one or both of the first and second relays.
 42. A method of controlling a spa heater in a system wherein first and second heater relays are closeable to supply current to said heater, the method comprising: (a) detect zero crossings of a waveform of a voltage supplied to said heater; (b) causing a first closing of a first heater relay; (c) cause a first closing of the second heater relay; (d) sensing the time at which the second heater relay is closed; (e) measuring the time delay T_(D) between the time that the second heater relay is closed and the time at which heater current is initially sensed; and (f) employing the measured time delay T_(D) to adjust the time at which a subsequent closing of the second heater relay is caused to occur so that a zero crossing of the heater current occurs closer in time to a zero crossing of the voltage waveform.
 43. Control circuitry for controlling a spa heater comprising: first and second relays closeable to supply current to said heater; a current sensor for sensing said current and generating a current sense signal; a microcontroller supplied with the current sense signal and configured to: (a) cause a closing of the first heater relay while leaving the second heater relay open, then; (b) detect a fault if current sensed by said current sensor is expected to be near zero but is greater than near zero; (c) cause an opening of the first heater relay while leaving the second heater relay closed, then; (d) detect a fault if the current sensed by said current sensor is expected near zero but is greater than near zero.
 44. Control circuitry for controlling a spa pump motor comprising: first and second relays closeable to supply current to said motor; a current sensor for sensing motor current and generating a current sense signal; a voltage sensor for generating a voltage sense signal; and a microcontroller supplied with the current sense and voltage sense signals and configured to: (a) detect zero crossings of a voltage waveform from the voltage sense signal; (b) cause a first closing of the first relay; (c) cause a first closing of the second relay; (d) measure the time delay T_(D) between the time that the second relay is closed and the time at which current is initially sensed by the current sensor after the first closing of the second relay; and (e) employ the measured time delay T_(D) to adjust the time at which a subsequent closing of the second relay is caused to occur so that a zero crossing of the motor current occurs closer in time to a zero crossing of the voltage waveform.
 45. Voltage sensing circuitry comprising: a first diode connected in series with a current limiting resistance which is in turn connected in series with a Zener diode which is in turn connected in series with an optical coupler LED; wherein an A.C. input voltage to be sensed is coupleable across one terminal of said first diode and one terminal of said optical coupler LED; and wherein the optical coupler LED comprises part of an optical coupler circuit having an output which provides a voltage sense signal comprising a pulse train whose pulse width is proportional to the A.C. input voltage.
 46. The voltage sensing circuitry of claim 45 further comprising one or more microcontrollers or microprocessors configured to (a) determine the magnitude of the A.C. input voltage from the pulse width of the sensed voltage; (b) determine the frequency of the A.C. input voltage utilizing the period of the pulse train; and (c) determine a zero cross time of the A.C. input voltage waveform.
 47. The voltage sensing circuit of claim 46 wherein the zero crossing time is determined by implementing a timer to determine a timer value each time an edge of a pulse of the A.C. input voltage occurs.
 48. The voltage sensor of claim 46 wherein the zero cross time event is computed by determining the time of occurrence of the middle of a voltage waveform pulse and then adding or subtracting 25% of that period.
 49. The voltage sensor of claim 46 wherein, to compute the time occurrence of a zero voltage crossing, a free running timer is used and the one or more microcontrollers or microprocessors registers the timer value when each edge of a pulse occurs, then computes the timer value at the midpoint of the pulse, and then adds or subtracts 25% of that period time value to or from the center time value to establish the timer value for a zero crossing.
 50. The voltage sensor of claim 46 wherein the microcontroller employs an edge sensitive capture input and further employs software to first set the edge sensitive capture input to sense a positive transition of a voltage pulse train, whereafter the next positive signal edge of the pulse train causes the value of a free-running hardware timer to be transferred to a latch at the moment of the signal edge and also causes an interrupt to vector the microcontroller to a software routine which reads the latch value and re-programs the edge sensitive captive input to sense a negative edge of the pulse train.
 51. The voltage sensor of claim 50 wherein the same process occurs when a negative edge of the voltage pulse train occurs, such that the microcontroller software produces a string of positive and negative edge time values. 